<extend name="Public:admin"/>
<block name="extra-js">
<script src="__JS__/plugins/metisMenu.min.js"></script>
<script src="__JS__/plugins/jquery.dataTables.js"></script>
<script src="__JS__/plugins/dataTables.bootstrap.js"></script>

</block>
<block name="main-content">
<script>
    $(document).ready(function() {
        $('#users_table').dataTable();
    });
</script>
<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header">用户管理</h1>
    </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <a type="button" class="btn btn-outline btn-primary" href="{:U('User/addUser')}">添加用户</a>   
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover" id="users_table">
                            <thead>
                                <tr>
                                    <th>用户名</th>
                                    <th>登录名</th>
                                    <th>用户类型</th>
                                    <th>最后登录时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            	<volist name="user_arr" id="vo">
                            		<tr class="odd gradeX">
                                    <td>{$vo.username}</td>
                                    <td>{$vo.loginname}</td>
                                    <td>
                                    <if condition="$vo.usertype eq 0 "> 管理员
                                    <elseif condition="$vo.usertype eq 1"/>商家
                                        <else /> 用户
                                    </if>
                                    </td>
                                    <td class="center">{$vo.lastlogin}</td>
                                    <td class="center">
                                    	<a href="__URL__/editUser?id={$vo.user_id}">编辑</a>
                                    	<a href="javascript:if(confirm('{$delete_tip}')) location='__URL__/deleteUser?id={$vo.user_id}' ">删除</a>
                                    </td>
                                </tr>
                            	</volist>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</block>